|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
JavaClassWriter.java | 75% | 93.8% | 83.3% | 88.5% |
|
1 |
/*
|
|
2 |
* Copyright 2001-2004 The Apache Software Foundation.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
|
16 |
|
|
17 |
package org.apache.geronimo.ews.ws4j2ee.toWs;
|
|
18 |
|
|
19 |
import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
|
|
20 |
import org.apache.geronimo.ews.ws4j2ee.utils.Utils;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* abstract class writer
|
|
24 |
*
|
|
25 |
* @author Srianth Perera(hemapani@opensource.lk)
|
|
26 |
*/
|
|
27 |
public abstract class JavaClassWriter extends AbstractWriter { |
|
28 |
protected String qulifiedName;
|
|
29 |
protected String classname;
|
|
30 |
protected String packageName;
|
|
31 |
private String pacakgesatement;
|
|
32 |
private String targetDirectory;
|
|
33 |
|
|
34 | 13 |
public JavaClassWriter(J2EEWebServiceContext j2eewscontext, String qulifiedName) throws GenerationFault { |
35 | 13 |
super(j2eewscontext, Utils.getFileNamefromClass(j2eewscontext, qulifiedName));
|
36 | 13 |
this.qulifiedName = qulifiedName;
|
37 | 13 |
packageName = Utils.getPackageNameFromQuallifiedName(qulifiedName); |
38 | 13 |
classname = Utils.getClassNameFromQuallifiedName(qulifiedName); |
39 |
} |
|
40 |
|
|
41 | 13 |
public void writeCode() throws GenerationFault { |
42 | 13 |
if (out == null) |
43 | 2 |
return;
|
44 | 11 |
out.write((packageName != null) ? ("package " + packageName + ";\n") : ""); |
45 | 11 |
writeImportStatements(); |
46 | 11 |
writeClassComment(); |
47 | 11 |
out.write("public class "
|
48 |
+ classname |
|
49 |
+ getExtendsPart() |
|
50 |
+ getimplementsPart() |
|
51 |
+ "{\n");
|
|
52 | 11 |
writeAttributes(); |
53 | 11 |
writeConstructors(); |
54 | 11 |
writeMethods(); |
55 | 11 |
out.write("}\n");
|
56 |
} |
|
57 |
|
|
58 | 11 |
protected String getExtendsPart() {
|
59 | 11 |
return " "; |
60 |
} |
|
61 |
|
|
62 | 0 |
protected String getimplementsPart() {
|
63 | 0 |
return " "; |
64 |
} |
|
65 |
|
|
66 | 11 |
protected void writeClassComment() throws GenerationFault { |
67 |
} |
|
68 |
|
|
69 | 11 |
protected void writeImportStatements() throws GenerationFault { |
70 |
} |
|
71 |
|
|
72 |
protected abstract void writeAttributes() throws GenerationFault; |
|
73 |
|
|
74 |
protected abstract void writeConstructors() throws GenerationFault; |
|
75 |
|
|
76 |
protected abstract void writeMethods() throws GenerationFault; |
|
77 |
} |
|
78 |
|
|